Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split setgid and setuid, add privilege check [RFC] #911

Merged
merged 1 commit into from
Sep 27, 2016

Conversation

@@ -156,10 +156,18 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
if (getuid() != geteuid() || getgid() != getegid()) {
if (setgid(getgid()) != 0 || setuid(getuid()) != 0) {
if (setgid(getgid()) != 0){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style error here, space between ) and {

@ddevault ddevault merged commit 4e66097 into swaywm:master Sep 27, 2016
@thejan2009 thejan2009 deleted the setgid-setuid branch October 8, 2016 07:14
emersion pushed a commit that referenced this pull request Feb 11, 2020
It looks like the code to drop privileges may have been broken via
commit 37f0e1f. That commit reverted the correct order from #911, which
first drops the gid then the uid. If setuid is called first then the
target user may not have the ability to setgid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants